#include <iostream>
#include <stdio.h>
using namespace std;

class A{
public:
    A()
    {
        mlen=0;
        a=NULL;
     }
    
    A(int len)
    {
        mlen=len;
        a=new int[mlen];
    }
    
    	
    int &operator[](int i)
    {
    	return a[i];//返回元素的引用，this->a[i]
    }

    int operator()(int x,int y)
    {
        return (x*x+y*y);
    }
    	
public:
	int mlen;	
    int *a;
};
	
 
int main()
{
	A aa(10);
	aa[3]=333;
    printf("%d\n",aa[3]);

    int c=0;
    c=aa(1,2);
    printf("%d\n",c);
    
	return 0;	
}
